const Base = require("../base.js");
/**
 * 中文转汉字
 */
module.exports = class extends Base {
    async indexAction() {
        // 多个用逗号隔开
        const text = this.get("text").split(",")
        const {auto_translation} = await this.dxPost("https://yi.qq.com/api/imt", {
            "header":
            {
                "fn": "auto_translation",
                "client_key": "browser-chrome-112.0.0-Windows 10-ca513e05-e0e9-4c4f-832d-cb5ba7a686bc-1683341493243"
            },
            "type": "plain", "model_category": "normal", "text_domain": "general",
            "source": { "lang": "zh", "text_list": text }, "target": { "lang": "en" }
        })
        this.success(auto_translation);
    }
};
